{%* var folder comes with include file directive *%}

{%section name='tr' loop=$tree%}
   {%if $smarty.section.tr.first%}
      <select{%if $folder|default:0 eq 1%} onchange='submit();'{%/if%} name='cat' id='category'>
      {%if $folder eq 0%}
      <option value=''> -- Категория? -- </option>
      {%/if%}
   {%/if%}
      {%if $folder|default:0 neq 0 or $tree[tr].folder eq false%}
      <option value='{%$tree[tr].id%}'{%if $tree[tr].id eq $category%} selected{%/if%}> 
      {%assign var='path' value=$tree[tr].path%}
      {%foreach from=$path item='value' name='p'%}
         {%$value%}
         {%if $smarty.foreach.p.last eq false%}&nbsp;/&nbsp;{%/if%} 
      {%/foreach%}
      </option>
      {%/if%}
   {%if $smarty.section.tr.last%}
   </select> 
   {%/if%} 
{%sectionelse%} 
   <span class='warn'>Не созданы категории для данного модуля</span> 
{%/section%} 